From 288ff7e0580f7fd87061922fbba41708168c9c6e Mon Sep 17 00:00:00 2001 From: Joe Shaw Date: Fri, 18 May 2001 03:41:30 +0000 Subject: [PATCH] Remove the assertions that x_offset and y_offset must be >= 0. Clip the 2001-05-17 Joe Shaw * gtk/gtktextdisplay.c (gtk_text_layout_draw): Remove the assertions that x_offset and y_offset must be >= 0. Clip the cursor being drawn if it is only partially onscreen. --- ChangeLog | 6 ++++++ ChangeLog.pre-2-0 | 6 ++++++ ChangeLog.pre-2-10 | 6 ++++++ ChangeLog.pre-2-2 | 6 ++++++ ChangeLog.pre-2-4 | 6 ++++++ ChangeLog.pre-2-6 | 6 ++++++ ChangeLog.pre-2-8 | 6 ++++++ gtk/gtktextdisplay.c | 4 ++-- 8 files changed, 44 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 119501f6c5..d74580a8bc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2001-05-17 Joe Shaw + + * gtk/gtktextdisplay.c (gtk_text_layout_draw): Remove the assertions + that x_offset and y_offset must be >= 0. Clip the cursor being drawn + if it is only partially onscreen. + Thu May 17 17:10:13 2001 Owen Taylor * gtk/gtkentry.c: Make logical motion and deletion by graphemes, diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 119501f6c5..d74580a8bc 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,9 @@ +2001-05-17 Joe Shaw + + * gtk/gtktextdisplay.c (gtk_text_layout_draw): Remove the assertions + that x_offset and y_offset must be >= 0. Clip the cursor being drawn + if it is only partially onscreen. + Thu May 17 17:10:13 2001 Owen Taylor * gtk/gtkentry.c: Make logical motion and deletion by graphemes, diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 119501f6c5..d74580a8bc 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +2001-05-17 Joe Shaw + + * gtk/gtktextdisplay.c (gtk_text_layout_draw): Remove the assertions + that x_offset and y_offset must be >= 0. Clip the cursor being drawn + if it is only partially onscreen. + Thu May 17 17:10:13 2001 Owen Taylor * gtk/gtkentry.c: Make logical motion and deletion by graphemes, diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 119501f6c5..d74580a8bc 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,9 @@ +2001-05-17 Joe Shaw + + * gtk/gtktextdisplay.c (gtk_text_layout_draw): Remove the assertions + that x_offset and y_offset must be >= 0. Clip the cursor being drawn + if it is only partially onscreen. + Thu May 17 17:10:13 2001 Owen Taylor * gtk/gtkentry.c: Make logical motion and deletion by graphemes, diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 119501f6c5..d74580a8bc 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,9 @@ +2001-05-17 Joe Shaw + + * gtk/gtktextdisplay.c (gtk_text_layout_draw): Remove the assertions + that x_offset and y_offset must be >= 0. Clip the cursor being drawn + if it is only partially onscreen. + Thu May 17 17:10:13 2001 Owen Taylor * gtk/gtkentry.c: Make logical motion and deletion by graphemes, diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 119501f6c5..d74580a8bc 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,9 @@ +2001-05-17 Joe Shaw + + * gtk/gtktextdisplay.c (gtk_text_layout_draw): Remove the assertions + that x_offset and y_offset must be >= 0. Clip the cursor being drawn + if it is only partially onscreen. + Thu May 17 17:10:13 2001 Owen Taylor * gtk/gtkentry.c: Make logical motion and deletion by graphemes, diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 119501f6c5..d74580a8bc 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +2001-05-17 Joe Shaw + + * gtk/gtktextdisplay.c (gtk_text_layout_draw): Remove the assertions + that x_offset and y_offset must be >= 0. Clip the cursor being drawn + if it is only partially onscreen. + Thu May 17 17:10:13 2001 Owen Taylor * gtk/gtkentry.c: Make logical motion and deletion by graphemes, diff --git a/gtk/gtktextdisplay.c b/gtk/gtktextdisplay.c index 0b2c3f7872..c06c7cb487 100644 --- a/gtk/gtktextdisplay.c +++ b/gtk/gtktextdisplay.c @@ -698,8 +698,6 @@ gtk_text_layout_draw (GtkTextLayout *layout, g_return_if_fail (layout->default_style != NULL); g_return_if_fail (layout->buffer != NULL); g_return_if_fail (drawable != NULL); - g_return_if_fail (x_offset >= 0); - g_return_if_fail (y_offset >= 0); g_return_if_fail (width >= 0); g_return_if_fail (height >= 0); @@ -794,11 +792,13 @@ gtk_text_layout_draw (GtkTextLayout *layout, else gc = widget->style->text_gc[GTK_STATE_NORMAL]; + gdk_gc_set_clip_rectangle(gc, &clip); gdk_draw_line (drawable, gc, line_display->x_offset + cursor->x - x_offset, current_y + line_display->top_margin + cursor->y, line_display->x_offset + cursor->x - x_offset, current_y + line_display->top_margin + cursor->y + cursor->height - 1); + gdk_gc_set_clip_rectangle(gc, NULL); cursor_list = cursor_list->next; } -- 2.30.2